home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / te2_130t.zip / TE2INST.003 / MCIMail.scr < prev    next >
Text File  |  1994-03-28  |  1KB  |  47 lines

  1. ;
  2. ;  TE/2 Script Language
  3. ;   Copyright 1990-94, Oberon Software, Mankato, MN
  4. ;
  5. ;   TE/2 Script Language file for accessing your MCI MailBox
  6. ;
  7. ; ---------------------------------------------------------------------
  8. ;
  9. ; NOTE: This script illustrates use of the WATCHFOR construct in the
  10. ;       TE/2 Script Language.
  11. ;
  12. ; ---------------------------------------------------------------------
  13.  
  14. string  myID = "my_id"
  15. string  myPW = "password"
  16. integer mail = TRUE
  17. integer wtch
  18.  
  19. program
  20.  
  21.   if !connected
  22.     dial("MCI")
  23.   endif
  24.  
  25.   if connected
  26.     transmit("^M")
  27.     if waitfor("User name", 60)
  28.       wtch = watchfor("There are no messages waiting in your INBOX", "mail = FALSE")
  29.       transmit("%s^M", myID)
  30.       waitfor("Password", 10)
  31.       transmit("%s^M", myPW)
  32.       waitfor("Command:", 30)
  33.       cancelwatch(wtch)
  34.       if !mail
  35.         if GetYesNo("There is no mail waiting.", "Do you want to exit MCI Mail?", TRUE)
  36.           transmit("exit^M")
  37.           waitfor("by remote source", 30)
  38.           hangup(FALSE)
  39.         endif
  40.       endif
  41.     else
  42.       hangup(TRUE)
  43.     endif
  44.   endif
  45.   end
  46.  
  47.